<div class="layui-hide" id='enian-nav-bar'>
	<!-- 默认选中菜单左侧 -->
	<a type='menu' data-url="{:url('index/adminlist')}"></a>
	<a data-url="{:url('index/adminlist')}">用户列表</a>
	<a data-url="">添加用户</a>
</div>
<div style="padding: 25px;">
	<form class="layui-form layui-form-pane" method="post" action="{:url('',['t'=>1])}">
	  
	  <div class="layui-form-item">
	    <label class="layui-form-label">账号</label>
	    <div class="layui-input-inline">
	      <input type="text" name="username" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
	    </div>
	  </div>
	  
	  
	  
	  <div class="layui-form-item">
	    <label class="layui-form-label">密码</label>
	    <div class="layui-input-inline">
	      <input type="text" name="password" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
	    </div>
	    <!--<div class="layui-form-mid layui-word-aux">随机生成</div>-->
	  </div>
	  
	  <div class="layui-form-item">
	    <label class="layui-form-label">名字</label>
	    <div class="layui-input-inline">
	      <input type="text" name="name" lay-verify="required" placeholder="名称" autocomplete="off" class="layui-input">
	    </div>
	  </div>
	  
	 
	  
	  <div class="layui-form-item">
	    <label class="layui-form-label">状态</label>
	    <div class="layui-input-inline">
	      <select name="status" >
	        <option value="0">停用</option>
	        <option value="1">启用</option>
	      </select>
	    </div>
	  </div>
	
	 <div class="layui-form-item">
	    <label class="layui-form-label">备注</label>
	    <div class="layui-input-block">
	      <input type="text" name="note" lay-verify="" placeholder="请输入" autocomplete="off" class="layui-input">
	    </div>
	  </div>
	  
	  <!--<div class="layui-form-item layui-form-text">
	    <label class="layui-form-label">数据表模板页提示</label>
	    <div class="layui-input-block">
	      <textarea placeholder="请输入内容" class="layui-textarea"></textarea>
	    </div>
	  </div>-->
	  
	  
	  <div class="layui-form-item">
	    <button class="layui-btn" lay-submit="" lay-filter="addAdmin">保存</button>
	  </div>
	</form>
</div> 
<script>
//Demo
layui.use('form', function(){
  var form = layui.form;
  
	form.render()
  	//监听提交
	form.on('submit(addAdmin)', function(data){
	   // layer.msg(JSON.stringify(data.field));
	    //return false;
	    layui.$.post("{:url('addadmin',['t'=>1])}",data.field, function(data) {
			if(data.code==1){
				layui.layer.msg('添加成功');
				enianAdmin.go("{:url('index/adminlist')}");
			}else{
				layui.layer.alert('添加失败')
			}
		});
		
		return false;
	});
});
</script>